package org.third.common.domain;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.Parameter;

@Entity
@Table(name = "suite_configuration_pod")
public class SuiteConfigurationPod {

	@Id  
    @GeneratedValue(generator="MyGenerator")
    @GenericGenerator(name="MyGenerator", strategy="foreign", parameters=@Parameter(value="deployment", name = "property"))  
	@Column(name = "deployment_id")
	private Long deploymentId;

	@Column(name = "suite" ,nullable = true)
	private String suite;
	
	@Column(name = "suite_version",nullable = true)
	private String suiteVersion;
	
	@Column(name = "namespace",nullable = true)
	private String namespace;
	
	@Column(name = "label_key",nullable = true)
	private String labelKey;
	
	@Column(name = "label_value",nullable = true)
	private String labelValue;
	
	@Column(name = "nfs_ip",nullable = true)
	private String nfsIp;
	
	@Column(name = "nfs_output_path",nullable = true)
	private String nfsOutputPath;
	
	@Column(name = "current_suite_instance_number",nullable = true)
	private int currentSuiteInstanceNumber;
	
	//Bi one-to-one, using Deployment id as table id
	@OneToOne(cascade=CascadeType.ALL, fetch = FetchType.LAZY)  
	@JoinColumn(name="deployment_id")
	private Deployment  deployment;
	
	//one-way one-to-one, hold KubeBatchJob Id
	@OneToOne(cascade=CascadeType.ALL, fetch = FetchType.LAZY)
	@JoinColumn(name ="kube_batch_job_id")
	private KubeBatchJob  kubeBatchJob;

	public Long getDeploymentId() {
		return deploymentId;
	}

	public void setDeploymentId(Long deploymentId) {
		this.deploymentId = deploymentId;
	}

	public String getSuite() {
		return suite;
	}

	public void setSuite(String suite) {
		this.suite = suite;
	}

	public String getSuiteVersion() {
		return suiteVersion;
	}

	public void setSuiteVersion(String suiteVersion) {
		this.suiteVersion = suiteVersion;
	}

	public String getNamespace() {
		return namespace;
	}

	public void setNamespace(String namespace) {
		this.namespace = namespace;
	}

	public String getLabelKey() {
		return labelKey;
	}

	public void setLabelKey(String labelKey) {
		this.labelKey = labelKey;
	}

	public String getLabelValue() {
		return labelValue;
	}

	public void setLabelValue(String labelValue) {
		this.labelValue = labelValue;
	}

	public int getCurrentSuiteInstanceNumber() {
		return currentSuiteInstanceNumber;
	}

	public void setCurrentSuiteInstanceNumber(int currentSuiteInstanceNumber) {
		this.currentSuiteInstanceNumber = currentSuiteInstanceNumber;
	}

	public Deployment getDeployment() {
		return deployment;
	}

	public void setDeployment(Deployment deployment) {
		this.deployment = deployment;
	}

	public KubeBatchJob getKubeBatchJob() {
		return kubeBatchJob;
	}

	public void setKubeBatchJob(KubeBatchJob kubeBatchJob) {
		this.kubeBatchJob = kubeBatchJob;
	}

	public String getNfsIp() {
		return nfsIp;
	}

	public void setNfsIp(String nfsIp) {
		this.nfsIp = nfsIp;
	}

	public String getNfsOutputPath() {
		return nfsOutputPath;
	}

	public void setNfsOutputPath(String nfsOutputPath) {
		this.nfsOutputPath = nfsOutputPath;
	}
	
}

